package models

import "gorm.io/gorm"

type Video struct {
	gorm.Model
	UserId    int    `gorm:"type:int(11)"`
	Title     string `gorm:"type:varchar(30)"`
	Category  string `gorm:"type:varchar(30)"`
	VideoLink string `gorm:"type:varchar(300)"`
	CoverLink string `gorm:"type:varchar(300)"`
}

func (v *Video) VideoDetail(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(v).Error
}
